﻿<%@ Page Language="C#" MasterPageFile="~/PresentationLayer/Split.Master" AutoEventWireup="true" CodeBehind="AdicPerc.aspx.cs" Inherits="Distrackting.PresentationLayer.AdicPerc" Title="Distrackting: Adicionar Percurso" %>
<%@ Register assembly="Microsoft.Live.ServerControls.VE" namespace="Microsoft.Live.ServerControls.VE" tagprefix="ve" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="side" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rest" runat="server">
        <div class="border large box">
            <asp:ObjectDataSource ID="LocalidadeDataSource" runat="server" 
                SelectMethod="getLocalidades" 
                TypeName="Distrackting.BusinessLayer.GerirLocalidade">
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="EpocaDataSource" runat="server" 
                SelectMethod="getEpocas" TypeName="Distrackting.BusinessLayer.GerirEpoca">
            </asp:ObjectDataSource>
            
            
            <asp:ObjectDataSource ID="AmbitoDataSource" runat="server" 
                SelectMethod="getAmbitos" TypeName="Distrackting.BusinessLayer.GerirAmbito">
            </asp:ObjectDataSource>
            
            
            <asp:ObjectDataSource ID="DesnivelDataSource" runat="server" 
                SelectMethod="getDesnivel" TypeName="Distrackting.BusinessLayer.GerirDesnivel">
            </asp:ObjectDataSource>
            
            
            <asp:ObjectDataSource ID="Entidade_RespDataSource" runat="server" 
                SelectMethod="getEntidades" 
                TypeName="Distrackting.BusinessLayer.GerirEntidadeResponsavel">
            </asp:ObjectDataSource>
            
            <asp:ObjectDataSource ID="DificuldadeDataSource" runat="server" 
                SelectMethod="getDificuldades" 
                TypeName="Distrackting.BusinessLayer.GerirDificuldade">
            </asp:ObjectDataSource>
          
            <asp:ObjectDataSource ID="Tipo_percursoDataSource" runat="server" 
                SelectMethod="getTipo_percurso" 
                TypeName="Distrackting.BusinessLayer.GerirTipoPercurso">
            </asp:ObjectDataSource>
            

            
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            

            
            <h1 class ="pagetitle"><asp:Label ID="Label21" runat="server" Text="Adicionar Percurso"></asp:Label></h1>
            <br />
            

            
            <asp:Label ID="Label1" runat="server" Text="Nome:" CssClass="form_lab"></asp:Label>
            &nbsp;<asp:TextBox ID="textbox_nome" runat="server" CssClass="form_fld"></asp:TextBox>    
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="textbox_nome" ErrorMessage="Nome">*</asp:RequiredFieldValidator>
            <br />
            <asp:Label ID="Label2" runat="server" Text="Localidade de partida:" 
                CssClass="form_lab"></asp:Label>
            
            <asp:DropDownList ID="DropDown_partida" runat="server" AppendDataBoundItems="True" 
                onselectedindexchanged="DropDown_partida_SelectedIndexChanged" 
                AutoPostBack="True" DataSourceID="LocalidadeDataSource" DataTextField="nome" 
                DataValueField="cod_localidade" CssClass="form_fld">
                <asp:ListItem Value="0" Selected="True">Selecione...</asp:ListItem>
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Adicionar nova...</asp:ListItem>
            </asp:DropDownList>
            <asp:Panel ID="Panel2" runat="server" visible="false" Width="358px" 
                CssClass="form_f" Height="29px">
                <asp:Label ID="Label11" runat="server" Text="Nova localidade: " 
                    CssClass="form_lab"></asp:Label>
                <asp:TextBox ID="TextBoxNovaLocalParti" runat="server" CssClass="form_fld"></asp:TextBox>
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ControlToValidate="DropDown_partida" Display="Dynamic" 
                    ErrorMessage="Localidade de partida" Operator="NotEqual" ValueToCompare="0">*</asp:CompareValidator>
            </asp:Panel>
            <br />
            
            <asp:Label ID="Label3" runat="server" Text="Localidade de chegada:" 
                CssClass="form_lab"></asp:Label>            
            <asp:DropDownList ID="DropDown_chegada" runat="server" 
                 DataSourceID="LocalidadeDataSource" DataTextField="nome" 
                 DataValueField="cod_localidade" AppendDataBoundItems="True" 
                AutoPostBack="True" 
                onselectedindexchanged="DropDown_chegada_SelectedIndexChanged" 
                CssClass="form_fld">
                <asp:ListItem Value="0">Selecione...</asp:ListItem>
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Adiconar nova...</asp:ListItem>
            </asp:DropDownList>
            
            <asp:Panel ID="Panel3" runat="server" visible="false" Width="359px">
                <asp:Label ID="Label18" runat="server" Text="Nova localidade: " 
                    CssClass="form_lab"></asp:Label>
                <asp:TextBox ID="TextBoxNovaLocalChegada" runat="server" CssClass="form_fld"></asp:TextBox>
                <asp:CompareValidator ID="CompareValidator2" runat="server" 
                    ControlToValidate="DropDown_chegada" Display="Dynamic" 
                    ErrorMessage="Localidade de chegada" Operator="NotEqual" ValueToCompare="0">*</asp:CompareValidator>
            </asp:Panel> 
            
                  
                  
            <br />
            
                  
                  
            <asp:Label ID="Label7" runat="server" Text="Época:" CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownEpoca" runat="server" 
                DataSourceID="EpocaDataSource" DataTextField="epoca" 
                DataValueField="cod_epoca" AppendDataBoundItems="True" CssClass="form_fld">
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>
            </asp:DropDownList>
            
            
            <br />
            
            
            <asp:Label ID="Label8" runat="server" Text="Âmbito:" CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownAmbito" runat="server" 
                DataSourceID="AmbitoDataSource" DataTextField="descricao" 
                DataValueField="cod_ambito" AppendDataBoundItems="True" 
                CssClass="form_fld" style="margin-bottom: 0px">
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>
            </asp:DropDownList>
            
            
            <br />
            
            
            <asp:Label ID="Label9" runat="server" Text="Desnivel:" CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownDesnivel" runat="server" 
                DataSourceID="DesnivelDataSource" DataTextField="descricao" 
                DataValueField="cod_desnivel" AppendDataBoundItems="True" 
                CssClass="form_fld">
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>
            </asp:DropDownList>
            
            
            <br />
            
            
            <asp:Label ID="Label10" runat="server" Text="Entidade responsável:" 
                CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownEntidade" runat="server" 
                DataSourceID="Entidade_RespDataSource" DataTextField="nome" 
                DataValueField="cod_entidade" 
                onselectedindexchanged="DropDownEntidade_SelectedIndexChanged" 
                AppendDataBoundItems="True" AutoPostBack="True" CssClass="form_fld">
            
            <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>   
            <asp:ListItem Value="2">Adicionar nova</asp:ListItem>            
            </asp:DropDownList>
            
            
            <asp:Panel ID="PanelEntidade" style="display:block" runat="server" visible="false" 
                CssClass="form_lab" Width="329px" Height="66px">
                <asp:Label ID="Label14" runat="server" Text="Nome: " CssClass="form_lab"></asp:Label>
                <asp:TextBox ID="TextBoxNovaEntidade" runat="server" CssClass="form_fld"></asp:TextBox>
                <asp:Label ID="Label15" runat="server" Text="E-mail: " CssClass="form_lab"></asp:Label>
                <asp:TextBox ID="TextBoxEmail" runat="server" CssClass="form_fld"></asp:TextBox>
                <br />
                <asp:Label ID="Label16" runat="server" Text="Website: " CssClass="form_lab"></asp:Label>
                <asp:TextBox ID="TextBoxWebSite" runat="server" CssClass="form_fld"></asp:TextBox>
            </asp:Panel>
            
            
            <br />
            
            <br />
            
            
            <asp:Label ID="Label12" runat="server" Text="Dificuldade:" CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownDif" runat="server" DataSourceID="DificuldadeDataSource" 
                DataTextField="descricao" DataValueField="cod_dificuldade" 
                AppendDataBoundItems="True" CssClass="form_fld">
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>
            </asp:DropDownList>
          
            <br />
          
            <asp:Label ID="Label13" runat="server" Text="Tipo de percurso:" 
                CssClass="form_lab"></asp:Label>
            <asp:DropDownList ID="DropDownTipo" runat="server" 
                DataSourceID="Tipo_percursoDataSource" DataTextField="descricao" 
                DataValueField="cod_tipo" AppendDataBoundItems="True" CssClass="form_fld">
                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Selecione...</asp:ListItem>
            </asp:DropDownList>
            
            
            <br />
            
            <asp:Label ID="Label5" runat="server" Text="Duração (min) :" 
                CssClass="form_lab"></asp:Label>
            <asp:TextBox ID="Text_Duracao" runat="server" CssClass="form_fld"></asp:TextBox>
            
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="Text_Duracao" ErrorMessage="Duração">*</asp:RequiredFieldValidator>
            
          
            <asp:TextBox ID="Text_Descricao" runat="server" TextMode="MultiLine" 
                Height="146px" Width="403px"></asp:TextBox>
            
            &nbsp;<br />
            <br />
            <asp:Label ID="Label23" runat="server" Text="Data em que foi percorrido:"></asp:Label>
            <br />
            <asp:Calendar ID="Calendar1" runat="server" BackColor="White" 
                BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" 
                Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" 
                Width="200px">
                <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                <SelectorStyle BackColor="#CCCCCC" />
                <WeekendDayStyle BackColor="#FFFFCC" />
                <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                <OtherMonthDayStyle ForeColor="#808080" />
                <NextPrevStyle VerticalAlign="Bottom" />
                <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
            </asp:Calendar>
            <br />
            <br />
            <asp:Label ID="Label22" runat="server" 
                Text="Marque os pontos do percurso no mapa:"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             
            <ve:Map ID="Map1" 
                runat="server" DashboardSize="Small" EnableViewState="False" 
                Height="400px" Locale="pt_pt" MapStyle="Aerial" NavigationControl3D="False" 
                onserverclick="Map1_ServerClick" ScaleBarDistanceUnit="Kilometers" 
                Width="628px" ZoomLevel="11" Center-Latitude="41.727159287569073" 
                Center-Longitude="-8.1626701354980469" />
            
            <br />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" style="margin-left:auto; margin-right:auto; float:right;" 
                HeaderText="Por favor preencha os seguintes campos:" CssClass="form_lab" 
                Width="266px" />
            <asp:Button ID="Gravar" runat="server" Text="Gravar" style="float:right" onclick="Gravar_Click" />

        </div>
    
</asp:Content>
